package com.itheima.web.mapper.pms;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.vo.pms.ProductCategoryParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface PmsProductCategoryMapper extends BaseMapper<ProductCategoryParam> {
    @Insert("insert into pms_product_category_attribute_relation (product_category_id, product_attribute_id) values (#{categoryId} , #{attributeId})")
    void addProductCategoryAttibute(@Param("categoryId") Long categoryId, @Param("attributeId") Long attributeId);

    @Delete("delete from pms_product_category_attribute_relation where product_category_id = #{id}")
    void removeProductCategoryAttibute(Long id);
}
